﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="EvaluationCharts.aspx.cs" Inherits="BSCMFF.Web.Pages.Reporting.EvaluationCharts" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Charting" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

        // Load the Visualization API and the piechart package.
        google.load('visualization', '1', { 'packages': ['corechart'] });

        // Set a callback to run when the Google Visualization API is loaded.
        google.setOnLoadCallback(drawChart);

        // Callback that creates and populates a data table, 
        // instantiates the pie chart, passes in the data and
        // draws it.
        function drawChart() {

            // Create our data table.
            var data = new google.visualization.DataTable();
            data.addColumn('string', 'Topping');
            data.addColumn('number', 'Slices');
            data.addRows([
        ['Mushrooms', 3],
        ['Onions', 1],
        ['Olives', 1],
        ['Zucchini', 1],
        ['Pepperoni', 2]
      ]);

            // Instantiate and draw our chart, passing in some options.
            var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
            chart.draw(data, { width: 400, height: 240 });
        }
    </script>

    <div id="chart_div"></div>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadChart1" />
                    <telerik:AjaxUpdatedControl ControlID="EntityDataSourceEvaluationQuestionValues" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    <telerik:RadComboBox ID="RadComboBoxEvaluations" runat="server" 
        DataSourceID="EntityDataSourceEvaluations" DataTextField="Name" 
        DataValueField="ID" onselectedindexchanged="RadComboBox1_SelectedIndexChanged">
    </telerik:RadComboBox>
    <telerik:RadChart ID="RadChart1" runat="server" Visible="false"
        >
    </telerik:RadChart>

                <telerik:RadChart ID="RadChart2" SkinsOverrideStyles="true" runat="server" Visible="false">
                        <PlotArea>
                            <XAxis MaxValue="5" MinValue="1" Step="1">
                            </XAxis>
                            <YAxis MaxValue="3" Step="0.5" AxisMode="Extended">
                            </YAxis>
                            <YAxis2 MaxValue="5" MinValue="1" Step="1">
                            </YAxis2>
                        </PlotArea>
                        <Series>
                            <telerik:ChartSeries Name="Series 1" Type="Pie">
                                <Appearance>
                                    <FillStyle MainColor="Red">
                                    </FillStyle>
                                </Appearance>
                                <Items>
                                    <telerik:ChartSeriesItem YValue="1" Name="Item 1">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="2" Name="Item 2">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="1" Name="Item 3">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="3" Name="Item 4">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="2" Name="Item 5">
                                    </telerik:ChartSeriesItem>
                                </Items>
                            </telerik:ChartSeries>
                            <telerik:ChartSeries Name="Series 2">
                                <Appearance>
                                    <FillStyle MainColor="Blue">
                                    </FillStyle>
                                </Appearance>
                                <Items>
                                    <telerik:ChartSeriesItem YValue="3" Name="Item 1">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="1" Name="Item 2">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="3" Name="Item 3">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="1" Name="Item 4">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem YValue="2" Name="Item 5">
                                    </telerik:ChartSeriesItem>
                                </Items>
                            </telerik:ChartSeries>
                        </Series>
                    </telerik:RadChart>

    <asp:EntityDataSource ID="EntityDataSourceEvaluationQuestionValues" 
        runat="server" ConnectionString="name=BSCEntities" 
        DefaultContainerName="BSCEntities" EnableFlattening="False" 
        EntitySetName="Evaluation_User_Question_Value">
    </asp:EntityDataSource>


    <asp:EntityDataSource ID="EntityDataSourceEvaluations" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Evaluation_Period" 
        Select="it.[ID], it.[Name], it.[StartDate]">
    </asp:EntityDataSource>


</asp:Content>
